<?php

class Web_Svc_Boletin
{

    public function doIt()
    {
        $this->enviarBoletin();
    }

    private function enviarBoletin()
    {
        if ($_POST['boletin']) {
            $obj = new Web_Db_Boletin();
            $row = array('bol_email' => $_POST['boletin']);
            $obj->insert($row);

            $html = '';
            $html.='<table style="font:16px/22px \'Trebuchet MS\',Arial,Helvetica,sans-serif">';
            $html.='<tr><td><b>Email : </b></td><td>' . $_POST['boletin'] . '</td></tr>';
            $html.='</table>';

            $mail = new Zend_Mail();
            $mail->setFrom('servicios@manda.com.pe', 'MANDA.COM.PE');
            $mail->setSubject(Ey::utfToIso('Suscrito - ' . $_POST['boletin']));
            $mail->setBodyHtml($html);
            $mail->addTo('contacto@manda.com.pe');
            $mail->send();
        }
    }

}